package cn.jdbc.mysql;
//mysql add
import java.sql.*;

public class Test02 {
    public static void main(String[] args) throws Exception{
        Class.forName("com.mysql.jdbc.Driver");
        String url="jdbc:mysql://localhost:3306/test";
        String name="root";
        String password="root";
        Connection connection = DriverManager.getConnection(url, name,
                password);
        Statement statement = connection.createStatement();
        String sql="INSERT INTO `table-user`(`username`,`password`)\n" +
                "VALUES\n" +
                "('qingtian',MD5('456'));";
        int i = statement.executeUpdate(sql);
        if (i>0){
            System.out.println("插入成功");
        }
    }
}
